import request from '@/utils/request';
import { Channel } from '@/store/reducer/channel';

//获取频道数据
export const getChannelList = () =>
  request({
    url: '/v1_0/channels',
  });

//获取我的频道数据
export const getMyChannelList = () =>
  request({
    url: '/v1_0/user/channels',
  });

// 添加频道数据到我的频道列表
export const addMyChannel = (data: { channels: Channel[] }) =>
  request({
    url: '/v1_0/user/channels',
    method: 'put',
    data,
  });

// 删除频道数据
export const deleteChannelAPI = (id: number) =>
  request({
    url: ` /v1_0/user/channels/${id}`,
    method: 'delete',
  });
